<div ng-controller="clientCardCtrl">
    <div class="x_panel" >
        <div class="form-inline">
            <div class="form-group">
                <label>手机号 </label>
                <input type="text" ng-model="search.phone"  class="form-control" />
                <label>发放渠道 </label>
                <select class="form-control" ng-model="search.channel"
                        ng-options="o.id as o.val for o in $root.channel">
                    <option value="">--请选择--</option>
                </select>
                <label>卡券类型 </label>
                <select class="form-control" ng-model="search.cardType"
                        ng-options="o.id as o.val for o in $root.cardType">
                    <option value="">--请选择--</option>
                </select>
            </div>
            <button class="btn btn-primary" ng-click="find(1)" >查询</button>
            <button class="btn btn-default" ng-click="search={}" >重置</button>
            <button class="btn btn-danger pull-right mr5"  ng-click="uploadCancels()" ng-if="$root.hasPower('退保名单导入')">退保名单导入</button>
            <button class="btn btn-success pull-right mr5"  ng-click="uploadCostDetail()" ng-if="$root.hasPower('消费明细导入')">消费明细导入</button>
            <button class="btn btn-primary pull-right mr5"  ng-click="uploadCard()" ng-if="$root.hasPower('购物卡导入')">购物卡导入</button>
        </div>
    </div>
    <table class="table table-bordered table-striped table-hover" >
        <thead class="title">
        <tr>
            <th class="text-center">NO</th>
            <th>手机号</th>
            <th>发放渠道</th>
            <th>卡券类型</th>
            <th>金额</th>
            <th>起保日期</th>
            <th>退保日期</th>
            <th>已消费</th>
            <th>创建时间</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-if="pageModel.data.length == 0">
            <td colspan="100" class="text-center">暂无记录</td>
        </tr>
        <tr ng-repeat="item in pageModel.data">
            <td class="text-center">{{$index + 1+pageModel.pageSize*pageModel.pageIndex}}</td>
            <td>{{item.phone}}</td>
            <td>{{item.channel|keyToValue:channel:'id':'val'}}</td>
            <td>{{item.cardType|keyToValue:cardType:'id':'val'}}</td>
            <td>{{item.faceValue|currency}}</td>
            <td>{{item.createTime|date:'yyyy-MM-dd'}}</td>
            <td>{{item.cancelDate|date:'yyyy-MM-dd'}}</td>
            <td>{{item.consumption|currency}}</td>
            <td>{{item.createTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
        </tr>
        </tbody>
    </table>
    <div class="page-footer clearfix" >
        <page page-model="pageModel"></page>
    </div>
</div>